
<?php
$dbconfig = @include_once  dirname(dirname(__DIR__)).'/common/config/dbconfig.php';
if(!$dbconfig){
    $dbconfig='';
}
return [
    'name'=>'微商城',
    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
    'basePath' => dirname(__DIR__),
    'id' => 'app',
    'runtimePath' => '@data/runtime',
    'bootstrap' => [
        'admin','log'
    ],
    'controllerNamespace'=>'app\admin\controllers',
    'modules' => [
        'admin' => 'app\admin\Module',
        'install'=>'app\install\Module',
        'api'=>'app\api\Module',
        'gii' => [
            'class' => 'yii\gii\Module',
        ],
    ],
    'components' => [
        'db' => $dbconfig,

        "urlManager" => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
//            'suffix' => '.html',
//            'rules'=>[
//                [
//                    'pattern' => 'install',
//                    'route' => 'install/default/index',
//                    'suffix' => '.html',
//                ],
//            ]
        ],
        'assetManager' => [
            "basePath" => "@webroot/static/assets",
            "baseUrl" => "@web/static/assets",
            'linkAssets' => true,
            'bundles' => [
//                'yii\web\JqueryAsset' => [
//                    'js' => [
//                        YII_DEBUG ? 'jquery.js' : 'jquery.min.js'
//                    ]
//                ],
//                'yii\bootstrap\BootstrapAsset' => [
//                    'css' => [
//                        YII_DEBUG ? 'css/bootstrap.css' : 'css/bootstrap.min.css'
//                    ]
//                ],
//                'yii\bootstrap\BootstrapPluginAsset' => [
//                    'js' => [
//                        YII_DEBUG ? 'js/bootstrap.js' : 'js/bootstrap.min.js'
//                    ]
//                ],
                'dmstr\web\AdminLteAsset' => [
                    'skin' => 'skin-red-light',
                ],
            ]
        ],
        'cache' => [
            'class' => '\yii\caching\FileCache'
        ],
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            'useFileTransport' => true
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => [
                        'error',
                        'warning',
                         'info',
                    ]
                ]
            ]
        ],
        'user' => [
            'identityClass' => 'hass\user\models\User',
            'enableAutoLogin' => true,
            'identityCookie' => [
                'name' => '_backendIdentity',
                'httpOnly' => true
            ]
        ],
        'request' => [ // 避免前台的csrf和后台的冲突
            'csrfParam' => "_backendCsrf"
        ],
        'session' => [
            'name' => 'BACKENDSESSID'
        ],


    ],
    'params' => include_once 'params.php'
];
